feat(meta): expose authoritative create seeds via /meta/types (create-shape contract, Phase 2)#2276
Merged
Merged
Conversation
…-shape contract, Phase 2) Phase 1 (#2270) added the authoritative minimal create seeds in @objectstack/spec/kernel. Phase 2 delivers them to consumers: every /meta/types entry now carries an optional `createSeed`, so the Studio designer / CLI / API derive create defaults from the spec's single source of truth instead of re-inventing `createDefaults` (the drift that produced the dashboard-`layout` and action-`body` create→save 422s). - spec: barrel-export getMetadataCreateSeed / listMetadataCreateSeedTypes from /kernel; add optional `createSeed` to the GetMetaTypesResponse entry schema; regenerate api-surface (purely additive — 2 new exports). - objectql: getMetaTypes() attaches each type's seed to registry + runtime entries. Canvas-create types built interactively (report) stay absent. - dogfood: meta-types-create-seed.dogfood.test.ts asserts /meta exposes the dashboard/action seeds end-to-end and omits report's (4 pass). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 3 package(s): 95 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This closes the loop on the recurring "designer creates a minimal item that fails spec validation on save" family (dashboard
layout→ #2247; actionbody→ objectui#1950; report stale anchors). Root cause: the create-form's default shape was invented client-side (objectuicreateDefaults) and drifted from the spec's required fields, with nothing tying them together.Phase 1 (#2270) put the authoritative minimal create seeds in
@objectstack/spec/kernel. Phase 2 (this PR) delivers them to consumers so they derive create defaults from the spec's single source of truth.What
getMetadataCreateSeed/listMetadataCreateSeedTypesfrom/kernel; add an optionalcreateSeedto theGetMetaTypesResponseentry schema; regenerateapi-surface.json(purely additive — 2 new exports, signatures unchanged → satisfies the ADR-0059 freeze contract).getMetaTypes()attaches each type's seed to both registry-backed and runtime entries. Canvas-create types whose shape is built interactively (report) stay intentionally absent.meta-types-create-seed.dogfood.test.tsboots the showcase stack and assertsGET /metaexposes the dashboard seed (widgets:[]), the action seed (validbody), every seeded type's exact seed, and thatreportis omitted (4 pass).A runtime HTTP field — backward-compatible: old servers omit
createSeed, so the designer falls back to its existing defaults; new servers serve the authoritative seed.Verification
tsc --noEmit(CI gating step): 0 errors.check:api-surface: ✓ (regenerated, additive only).Follow-on (separate, objectui): the Studio designer reads
entry.createSeedfrom/meta/typesand uses it as the create default (replacing hardcodedcreateDefaults).🤖 Generated with Claude Code